import pandas as pd
import numpy as np


# create with DatetimeIndex
dates = pd.date_range('20130101', periods=6)
df = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD'))

df.head()
df.tail(3)
df.index
df.columns
df.values

print(df.describe())
print(df.T)

df.sort_index(axis=1, ascending=False)
df.sort_values(by='B')

# selection
#Selecting a single column, which yields a Series, equivalent to df.A
df['A']
#Selecting via [], which slices the rows.
df[0:3]
df['20130102':'20130104']

#Selection by Label
df.loc[dates[0]]
# Selecting on a multi-axis by label
df.loc[:,['A','B']]
df.loc['20130102':'20130104',['A','B']]
# Reduction in the dimensions of the returned object
df.loc['20130102',['A','B']]

# For getting a scalar value
df.loc[dates[0],'A']
df.at[dates[0],'A']

# Selection by Position
#Select via the position of the passed integers
df.iloc[3]
df.iloc[3:5,0:2]
df.iloc[[1,2,4],[0,2]]
df.iloc[1,1]
df.iat[1,1]